import request from '@/utils/request'

//查询所有角色
export function getRoleList(page,pageSize,name,description,createTime) {
  return request({
    url: '/sys/SysRoleController/systemManage/rolePermission/page',
    method: 'get',
    params : { page,pageSize,name,description,createTime }
  })
}

//角色下拉框
export function getRoleDown() {
  return request({
    url: '/sys/SysRoleController/systemManage/rolePermission/getRoleDown',
    method: 'get'
  })
}

//查询所有资源菜单
export function selectListPermission() {
  return request({
    url: '/sys/SysPermissionController/systemManage/rolePermission/selectListPermission',
    method: 'get'
  })
}
//查询单个角色
export function getRoleInfo(id) {
  return request({
    url: '/sys/SysRoleController/systemManage/rolePermission/getRoles',
    method: 'get',
    params : { id }
  })
}
//添加角色
export function addRole(data) {
  return request({
    url: '/sys/SysRoleController/systemManage/rolePermission/addRole',
    method: 'post',
    data
  })
}
//修改角色
export function updateRole(data) {
  return request({
    url: '/sys/SysRoleController/systemManage/rolePermission/updateRole',
    method: 'post',
    data
  })
}
//删除角色
export function deleteRole(data) {
  return request({
    url: '/sys/SysRoleController/systemManage/rolePermission/delRole',
    method: 'post',
    data
  })
}
